﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class Province : ActiveRecordBase<Province>
    {
		#region Const Definition
		
		public const string CONST_ProvinceID							= "ProvinceID";
		public const string CONST_ProvinceCode							= "ProvinceCode";
		public const string CONST_ProvinceEName							= "ProvinceEName";
		public const string CONST_ProvinceCName							= "ProvinceCName";
		public const string CONST_SortNumber							= "SortNumber";
		public const string CONST_CreateDate							= "CreateDate";
		public const string CONST_UpdateDate							= "UpdateDate";
        public const string CONST_Active								= "Active";
        public const string CONST_ClusterID                             = "ClusterID";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _provinceID;
        
        // Non Key
        private System.String _provinceCode;
        private System.String _provinceEName;
        private System.String _provinceCName;
        private System.Int32 _sortNumber;
        private Nullables.NullableDateTime _createDate;
        private Nullables.NullableDateTime _updateDate;
        private System.Boolean _active;
        private System.Int32 _clusterID;

        // Parents
        
        
		

        #endregion

        public Province() {
               
        }
        public Province(
            System.String provinceCode
            ,System.String provinceEName
            ,System.String provinceCName
            ,System.Int32 sortNumber
            ,Nullables.NullableDateTime createDate
            ,Nullables.NullableDateTime updateDate
            ,System.Boolean active
            ,System.Int32 clusterID) : this() {
                
            this._provinceCode = provinceCode; 
            this._provinceEName = provinceEName; 
            this._provinceCName = provinceCName; 
            this._sortNumber = sortNumber; 
            this._createDate = createDate; 
            this._updateDate = updateDate; 
            this._active = active;
            this._clusterID = clusterID;
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_PROVINCE_PROVINCEID")]
		#endif
        public System.Int32 ProvinceID {
            get { return this._provinceID; }
            set {  this._provinceID = value; }
        }
        
        // Non Key
        [Property]
        public System.String ProvinceCode {
            get { return this._provinceCode; }
			set { if (value == null) return; if (value.Length > 50) this._provinceCode = value.Substring(0,50); else this._provinceCode = value; }	
        }
        
        [Property]
        public System.String ProvinceEName {
            get { return this._provinceEName; }
			set { if (value == null) return; if (value.Length > 100) this._provinceEName = value.Substring(0,100); else this._provinceEName = value; }	
        }
        
        [Property]
        public System.String ProvinceCName {
            get { return this._provinceCName; }
			set { if (value == null) return; if (value.Length > 20) this._provinceCName = value.Substring(0,20); else this._provinceCName = value; }	
        }
        
        [Property]
        public System.Int32 SortNumber {
            get { return this._sortNumber; }
			set { this._sortNumber = value; }
        }
        
        [Property]
        public Nullables.NullableDateTime CreateDate {
            get { return this._createDate; }
			set { this._createDate = value; }
        }
        
        [Property]
        public Nullables.NullableDateTime UpdateDate {
            get { return this._updateDate; }
			set { this._updateDate = value; }
        }
        
        [Property]
        public System.Boolean Active {
            get { return this._active; }
			set { this._active = value; }
        }

        [Property]
        public System.Int32 ClusterID
        {
            get { return this._clusterID; }
            set { this._clusterID = value; }
        }
        
        // Parent Relationships
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public Province Clone()
		{
			Province newProvince = new Province();
			
            newProvince.ProvinceCode = this._provinceCode; 
            newProvince.ProvinceEName = this._provinceEName; 
            newProvince.ProvinceCName = this._provinceCName; 
            newProvince.SortNumber = this._sortNumber; 
            newProvince.CreateDate = this._createDate; 
            newProvince.UpdateDate = this._updateDate; 
            newProvince.Active = this._active;
            newProvince.ClusterID = this._clusterID;
			return newProvince;
		}
    }
}



